package com.chitranshu.sample;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

import com.chitranshu.activities.BottomTabActivity;

public class SampleBottomTabActivity extends BottomTabActivity {

	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
	}

	private View makeTabIndicator(int position) {
		ImageView tabView = new ImageView(this);
		tabView.setScaleType(ScaleType.FIT_CENTER);
		switch (position) {
		case 0:
			tabView.setImageResource(R.drawable.tab1);
			break;
		case 1:
			tabView.setImageResource(R.drawable.tab2);
			break;
		case 2:
			tabView.setImageResource(R.drawable.tab3);
			break;
		case 3:
			tabView.setImageResource(R.drawable.tab4);
			break;
		case 4:
			tabView.setImageResource(R.drawable.tab5);
			break;
		case 5:
			tabView.setImageResource(R.drawable.tab6);
			break;
		}
		return tabView;
	}

	@Override
	protected int getTabCount() {
		return 6;
	}

	@Override
	protected View getTabView(int position) {
		return makeTabIndicator(position);
	}

	@Override
	protected Intent getTabContent(int position) {
		switch (position) {
		case 0:
			return new Intent(this, Activity1.class);
		case 1:
			return new Intent(this, Activity3.class);
		case 2:
			return new Intent(this, Activity4.class);
		case 3:
			return new Intent(this, Activity5.class);
		case 4:
			return new Intent(this, Activity4.class);
		case 5:
			return new Intent(this, Activity3.class);
		}
		return null;
	}
}